package oms.ck.service;

import java.util.Random;

import oms.ck.dao.saydao;

public class sayService {
	private saydao dao = new saydao();
	//随机查询句子
	public String randomSentence() {
		//定义一个句子属性
		String sentence = null;
		//获取信息总条数
		int n = dao.getTotalCount();
		//获取随机id
		Random rad=new Random();
		int id=rad.nextInt(1,n+1);//从1到n
		//查询
		sentence = dao.getSentence(id);
		return sentence;
	}
}
